package com.easidea.tim.entity.supply;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springside.core.dao.extend.Undeletable;

import com.easidea.tim.entity.BaseEntity;
import com.easidea.tim.entity.system.Geography;

@Entity(name = "tim_supply_supplier")
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Undeletable(status = "deleted")
@Cache(region = "tim_supply_supplier", usage = CacheConcurrencyStrategy.READ_WRITE)
public class Sup extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -1577362013622436405L;
	public static final Short SUPPLIER_STATUS_ACTIVIED = 1; // 已激活 ，正常状态
	public static final Short SUPPLIER_STATUS_DISABLED = 0; // 已关闭，违例状态
	private String name;
	private String responser; // 负责人
	private String bizTel1;
	private String bizTel2;
	private String contactor;
	private String contactorPosition; // 联系人职务
	private String contactorMobile; // 联系人手机
	private String fax;
	private String address;
	private String postCode;
	private String bankName; // 开户行
	private String bankAccount; // 开户帐号
	private String taxNo;
	private String email;
	private String website;
	private String memo;
	private Short status;
	private SupType type; // 类型
	private Geography area;

	public Sup() {
		
	}
	public Sup(long id, String name, String contactor,String contactorMobile) {
		this.id = id;
		this.name = name;
		this.contactor = contactor;
		this.contactorMobile = contactorMobile;
	}
	/**
	 * @return the name
	 */
	@Column(name="name", nullable=false)
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the responser
	 */
	@Column( name="responser", nullable=false)
	public String getResponser() {
		return responser;
	}
	/**
	 * @param responser the responser to set
	 */
	public void setResponser(String responser) {
		this.responser = responser;
	}
	/**
	 * @return the bizTel1
	 */
	@Column(name="biz_tel1")
	public String getBizTel1() {
		return bizTel1;
	}
	/**
	 * @param bizTel1 the bizTel1 to set
	 */
	public void setBizTel1(String bizTel1) {
		this.bizTel1 = bizTel1;
	}
	/**
	 * @return the bizTel2
	 */
	@Column(name="biz_tel2")
	public String getBizTel2() {
		return bizTel2;
	}
	/**
	 * @param bizTel2 the bizTel2 to set
	 */
	public void setBizTel2(String bizTel2) {
		this.bizTel2 = bizTel2;
	}
	/**
	 * @return the contactor
	 */
	@Column(name="contactor")
	public String getContactor() {
		return contactor;
	}
	/**
	 * @param contactor the contactor to set
	 */
	public void setContactor(String contactor) {
		this.contactor = contactor;
	}
	/**
	 * @return the contactorPosition
	 */
	@Column(name="contactor_position")
	public String getContactorPosition() {
		return contactorPosition;
	}
	/**
	 * @param contactorPosition the contactorPosition to set
	 */
	public void setContactorPosition(String contactorPosition) {
		this.contactorPosition = contactorPosition;
	}
	/**
	 * @return the contactorMobile
	 */
	@Column(name="contactor_mobile")
	public String getContactorMobile() {
		return contactorMobile;
	}
	/**
	 * @param contactorMobile the contactorMobile to set
	 */
	public void setContactorMobile(String contactorMobile) {
		this.contactorMobile = contactorMobile;
	}
	/**
	 * @return the fax
	 */
	@Column(name="fax")
	public String getFax() {
		return fax;
	}
	/**
	 * @param fax the fax to set
	 */
	public void setFax(String fax) {
		this.fax = fax;
	}
	/**
	 * @return the address
	 */
	@Column(name="address")
	public String getAddress() {
		return address;
	}
	/**
	 * @param address the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}
	/**
	 * @return the postCode
	 */
	@Column(name="post_code")
	public String getPostCode() {
		return postCode;
	}
	/**
	 * @param postCode the postCode to set
	 */
	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}
	/**
	 * @return the bankName
	 */
	@Column(name="bank_name")
	public String getBankName() {
		return bankName;
	}
	/**
	 * @param bankName the bankName to set
	 */
	public void setBankName(String bankName) {
		this.bankName = bankName;
	}
	/**
	 * @return the bankAccount
	 */
	@Column(name="bank_account")
	public String getBankAccount() {
		return bankAccount;
	}
	/**
	 * @param bankAccount the bankAccount to set
	 */
	public void setBankAccount(String bankAccount) {
		this.bankAccount = bankAccount;
	}
	/**
	 * @return the taxNo
	 */
	@Column(name="tax_no")
	public String getTaxNo() {
		return taxNo;
	}
	/**
	 * @param taxNo the taxNo to set
	 */
	public void setTaxNo(String taxNo) {
		this.taxNo = taxNo;
	}
	/**
	 * @return the email
	 */
	@Column(name="email")
	public String getEmail() {
		return email;
	}
	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}
	/**
	 * @return the website
	 */
	@Column(name="website")
	public String getWebsite() {
		return website;
	}
	/**
	 * @param website the website to set
	 */
	public void setWebsite(String website) {
		this.website = website;
	}
	/**
	 * @return the memo
	 */
	@Column(name="memo")
	public String getMemo() {
		return memo;
	}
	/**
	 * @param memo the memo to set
	 */
	public void setMemo(String memo) {
		this.memo = memo;
	}
	/**
	 * @return the status
	 */
	@Column(name="status", nullable=false)
	public Short getStatus() {
		return status;
	}
	/**
	 * @param status the status to set
	 */
	public void setStatus(Short status) {
		this.status = status;
	}
	/**
	 * @return the type
	 */
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="type_id",nullable=false)
	public SupType getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(SupType type) {
		this.type = type;
	}
	/**
	 * @return the area
	 */
	@ManyToOne(cascade=CascadeType.MERGE)
	@JoinColumn(name="area_id", nullable=false)
	public Geography getArea() {
		return area;
	}
	/**
	 * @param area the area to set
	 */
	public void setArea(Geography area) {
		this.area = area;
	}

}
